package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.maindata.domain.Factory;
import com.qijian.maindata.domain.query.FactoryQuery;
import com.qijian.maindata.domain.query.ProcessQuery;
import com.qijian.maindata.domain.vo.FactoryVo;
import com.qijian.maindata.domain.vo.ProcessVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 工厂Mapper接口
 *
 * @author ruoyi
 * @date 2021-08-19
 */
public interface FactoryMapper extends BaseMapper<Factory> {
    Page<FactoryVo> selectPageVo(Page<Factory> page, @Param(Constants.WRAPPER) Wrapper<FactoryQuery> queryWrapper);

    List<FactoryVo> selectPageVo(@Param(Constants.WRAPPER) Wrapper<FactoryQuery> queryWrapper);

    FactoryVo selectById(@Param("id") Long id);

    @Select("select count(*) from fm_factory")
    int countAll();

    Page<ProcessVo> processPageVo(Page<ProcessVo> page, @Param(Constants.WRAPPER) Wrapper<ProcessQuery> queryWrapper);

    List<FactoryVo> selectFactoryAll();

    List<String> selectPostListByUserId(@Param("userId") Long userId);
}
